/**
 * Copyright (c) 2018, ShangHai HOWBUY INVESTMENT MANAGEMENT Co., Ltd.
 * All right reserved.
 * <p>
 * THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF HOWBUY INVESTMENT
 * MANAGEMENT CO., LTD.  THE CONTENTS OF THIS FILE MAY NOT BE DISCLOSED
 * TO THIRD PARTIES, COPIED OR DUPLICATED IN ANY FORM, IN WHOLE OR IN PART,
 * WITHOUT THE PRIOR WRITTEN PERMISSION OF HOWBUY INVESTMENT MANAGEMENT
 * CO., LTD.
 */
package com.howbuy.tms.web.controller;

import com.alibaba.fastjson.JSON;
import com.howbuy.tms.web.service.HystrixQueryService;
import com.howbuy.tms.web.service.QueryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @description:( 请在此添加描述)
 * @author hongdong.xie
 * @date 2018/12/24 15:40
 * @since JDK 1.7
 */
@RestController
public class FeginController {

    @Autowired
    private QueryService queryService;

    @Autowired
    private HystrixQueryService hystrixQueryService;

    /**
     * @GetMapping是一个组合注解 是@RequestMapping(method = RequestMethod.GET)的缩写
     * @PostMapping是一个组合注解 是@RequestMapping(method = RequestMethod.POST)的缩写
     */
    //    @GetMapping("/query")
    @RequestMapping("/query")
    public String query(){
        Map<String,String> map = queryService.query();

        return JSON.toJSONString(map);
    }

    @RequestMapping("/queryHystrix")
    public String queryHystrix(){
        Map<String,String> map = hystrixQueryService.query();

        return JSON.toJSONString(map);
    }
}
